Separate concerns: remove creation logic from brev start command #247
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Separate concerns: remove creation logic from brev start command
Summary
This PR refactors the
brev startcommand to focus solely on starting existing Brev instances, removing all workspace creation functionality. This separates concerns betweenbrev start(for starting existing instances) andbrev create(for creating new instances).Key Changes:
--name,--cpu,--gpu,--setup-script,--setup-repo,--setup-path,--org,--empty--detachedflag for non-blocking start operationsmaybeStartEmpty,maybeStartFromGitURL,maybeStartWithLocalPath,createEmptyWorkspace,createNewWorkspaceFromGit,MakeNewWorkspaceFromURL, and related creation logicStartStoreto remove creation-related methodsinstance_nameplaceholdermakeGitRepoFromURLinprofile.goto replace dependency on removedstart.MakeNewWorkspaceFromURLThis is a breaking change - users attempting to create workspaces with
brev startwill now receive error messages directing them to usebrev create.Review & Testing Checklist for Human
brev start <existing_instance_name>still works correctly for stopped instancesbrev start <non_existent_instance>andbrev startwith no args to confirm error messages are helpful and direct users tobrev createbrev start <instance> --detachedworks and doesn't block the shellbrev createcommand still works properly for workspace creationMakeNewWorkspaceFromURL,maybeStartEmpty, etc.Recommended test plan: Create a test instance with
brev create, stop it, then start it withbrev startto verify the full workflow still works end-to-end.Diagram
%%{ init : { "theme" : "default" }}%% graph TD StartCmd["pkg/cmd/start/start.go<br/>NewCmdStart()"]:::major-edit StartStore["StartStore interface"]:::major-edit RunStart["runStartWorkspace()"]:::major-edit MaybeStart["maybeStartStoppedOrJoin()"]:::context StartTest["pkg/cmd/start/start_test.go"]:::minor-edit ProfileCmd["pkg/cmd/profile/profile.go"]:::minor-edit CreateCmd["pkg/cmd/create/create.go"]:::context StartCmd --> StartStore StartCmd --> RunStart RunStart --> MaybeStart StartTest -.-> StartCmd ProfileCmd -.-> StartCmd subgraph "Removed Functions" RemovedFuncs["maybeStartEmpty()<br/>maybeStartFromGitURL()<br/>createEmptyWorkspace()<br/>MakeNewWorkspaceFromURL()"]:::removed end StartCmd -.->|"removed dependencies"| RemovedFuncs ProfileCmd -.->|"replaced with<br/>makeGitRepoFromURL()"| RemovedFuncs subgraph Legend L1[Major Edit]:::major-edit L2[Minor Edit]:::minor-edit L3[Context/No Edit]:::context L4[Removed]:::removed end classDef major-edit fill:#90EE90 classDef minor-edit fill:#87CEEB classDef context fill:#FFFFFF classDef removed fill:#FFB6C1Notes
brev startfunctionality while removing the creation aspect--detachedflag behavior is preserved for non-blocking operationsbrev createfor workspace creationLink to Devin run: https://app.devin.ai/sessions/8102944e41954c7b86d9860ea4b8adc4
Requested by: @theFong